﻿<phone:PhoneApplicationPage 
    x:Class="Appology.SugarSync.Explorer.Phone.Browse"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" xmlns:Converters="clr-namespace:Appology.SugarSync.Explorer.Phone.Converters" FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <Converters:PathInfoImageConverter x:Key="PathInfoImageConverter" />
        <DataTemplate x:Key="ContentsItemTemplate">
            <Button Style="{StaticResource TiltButtonStyle}" Click="PathInfoButton_Click">
        		<StackPanel Orientation="Horizontal">
        			<Image Margin="10,10,15,10" Height="75" Source="{Binding Converter={StaticResource PathInfoImageConverter}}" Loaded="Image_Loaded"/>
        			<TextBlock Margin="0,10,90,10" Text="{Binding Name}" FontSize="22" HorizontalAlignment="Right" VerticalAlignment="Center"/>
        		</StackPanel>
        	</Button>
        </DataTemplate>
        <Converters:CaseConverter x:Key="CaseConverter" />
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="RenameFolder" Text="rename folder" Click="RenameFolder_Click"/>
                <shell:ApplicationBarMenuItem x:Name="DeleteFolder" Text="delete folder" Click="DeleteFolder_Click"/>
                <shell:ApplicationBarMenuItem x:Name="CreateFolder" Text="create folder" Click="CreateFolder_Click"/>
                <shell:ApplicationBarMenuItem x:Name="Upload" Text="upload to folder" Click="Upload_Click"/>
                <shell:ApplicationBarMenuItem x:Name="Settings" Text="settings" Click="Settings_Click"/>
            </shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarIconButton x:Name="Refresh" IconUri="/icons/appbar.refresh.rest.png" Text="refresh" Click="Refresh_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Image Source="SugarSyncLogo.png" RenderTransformOrigin="0.5,0.5" Margin="45.354,23.354,-308.354,-23.354" UseLayoutRounding="False" d:LayoutRounding="Auto" Opacity="0.1">
        	<Image.RenderTransform>
        		<CompositeTransform Rotation="90"/>
        	</Image.RenderTransform>
        </Image>
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Margin="12,0,12,0">
            <controls:Pivot>
                <controls:PivotItem Header="{Binding Name, Converter={StaticResource CaseConverter}}">
                    <Grid>
                        <ScrollViewer d:LayoutOverrides="Height">
                            <ItemsControl x:Name="Contents" ItemsSource="{Binding Contents}" ItemTemplate="{StaticResource ContentsItemTemplate}"/>
                        </ScrollViewer>
                    </Grid>
                </controls:PivotItem>
            </controls:Pivot>
        </Grid>
        <ProgressBar x:Name="ProgressBar" IsIndeterminate="{Binding IsBusy}" Height="10" VerticalAlignment="Top"/>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
